package com.example.state.Impi;

import com.example.state.DaoContext;
import com.example.state.DaoControlState;

public class MybatisDaoImpi implements DaoControlState {
    @Override
    public int insert(int id, String value) {
        System.out.println("MybatisDaoImpi insert");
        return 0;
    }

    @Override
    public int update(int id, String value) {
        System.out.println("MybatisDaoImpi update");
        return 0;
    }

    @Override
    public void nextState(DaoContext daoContext) {
        daoContext.setDaoControlState(new SpringJdbcTemplateDaoImpi());
        System.out.println("已切换到SpringJdbcTemplate");
    }

    @Override
    public String getStateInfo() {
        return "mybatisDaoImpi";
    }
}
